package com.sx.service.user;

import com.sx.basic.IBasicService;
import com.sx.basic.ResponseEntity;
import com.sx.entity.finance.IncomeEntity;
import com.sx.entity.user.AmountEntity;
import com.sx.entity.user.UserEntity;

import java.math.BigDecimal;

/**
 * @author AdinZ
 * @date 2020/11/9 9:11
 */
public interface IUserService extends IBasicService<UserEntity,Long> {

    /**
     * 统一用户资金变动
     * @param uid 用户id
     * @param type 金额类型
     * @param amount 金额
     * @param sourceType 来源类型
     * @param sourceId 来源id
     * @param attribute 自定义属性
     * @return
     */
    boolean amountChange(long uid,
                      AmountEntity.AmountType type,
                      BigDecimal amount,
                      IncomeEntity.SourceType sourceType,
                      Long sourceId,String attribute);
    /**
     * 统一用户资金变动
     * @param uid 用户id
     * @param type 金额类型
     * @param amount 金额
     * @param sourceType 来源类型
     * @param sourceId 来源id
     * @return
     */
    boolean amountChange(long uid,
                         AmountEntity.AmountType type,
                         BigDecimal amount,
                         IncomeEntity.SourceType sourceType,
                         Long sourceId);


    /**
     * 统一 创建用户
     * @param userEntity 用户资料实体
     * @return
     */
    UserEntity createUser(UserEntity userEntity);

    /**
     * 用户状态变更
     * @param ids 用户id
     * @param state 状态
     * @return
     */
    boolean userState(Long[] ids, int state);
}
